{% extends "_base.html" %}

{% block title %}{{ track }}{% if track != '' %} - {% end %}{{ handler.get_runtime_conf('title') }}{% if handler.get_runtime_conf('topic') %} &middot; {{ handler.get_runtime_conf('topic') }}{% end %}{% end %}

{% block navs %}
{% module Template("_navs.html", menu='posts') %}
{% end %}

{% block main %}
<div class="row">
    <div class="span8">
        {% set slide = handler.get_runtime_conf('slide') %}
        {% if slide %}{% set slide = handler.get_escaper().json_decode(slide) %}{% end %}
        {% if slide %}
        <div id="carousel" class="carousel slide thumbnail">
            <ol class="carousel-indicators">
                {% for (i, v) in enumerate(slide) %}
                <li data-target="#carousel" data-slide-to="{{ i }}"{% if (not i) and (len(slide) > 1) %} class="active"{% end %}></li>
                {% end %}
            </ol>
            <div class="carousel-inner">
                {% for (i, v) in enumerate(slide) %}
                <div class="item{% if not i %} active{% end %}">
                    {% if ('href' in v) %}<a href="{{ v['href'] }}" target="_blank" title="{{ v['title'] }}"><img src="{{ v['image'] }}"></a>{% else %}<img src="{{ v['image'] }}">{% end %}
                    <div class="carousel-caption">
                        <h4>{{ v['title'] }}</h4>
                        <p>{{ v['descp'] }}</p>
                    </div>
                </div>
                {% end %}
            </div>
            {% if len(slide) > 1 %}
            <a class="left carousel-control" href="#carousel" data-slide="prev">‹</a>
            <a class="right carousel-control" href="#carousel" data-slide="next">›</a>
            {% end %}
        </div>
        {% end %}

        <ul class="breadcrumb">
            <li><a href="/"><i class="icon-home"></i></a> <span class="divider">/</span></li>
            <li><a href="/">活动日志</a> <span class="divider">/</span></li>
            <li class="active">{{ track }}</li>
        </ul>

        <div>
            {% module Template("index/index/posts.html", pager=pager, posts=posts, psers=psers, ptids=ptids, ptags=ptags) %}
        </div>
    </div>
    
    {% include "_side.html" %}
</div>
{% end %}
